package com.hmall.controller.back;

import com.hdmall.business.common.common.ServerResponse;
import com.hmall.service.CrawlerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/manage/crawler")
@Api(value = "后台爬虫操作API", description = "后台爬虫类API说明")
public class CrawlerController {
    private final CrawlerService crawlerService;

    @Autowired
    public CrawlerController(CrawlerService crawlerService) {
        this.crawlerService = crawlerService;
    }

    @GetMapping("getCrawler1")
    @ApiOperation(value = "获得爬虫1数据")
    public ServerResponse getCrawler1(){
        return crawlerService.getCrawler1();
    }

    @GetMapping("getCrawler2")
    @ApiOperation(value = "获得爬虫2数据")
    public ServerResponse getCrawler2(){
        return crawlerService.getCrawler2();
    }

    @GetMapping("getCrawler3")
    @ApiOperation(value = "获得爬虫3数据")
    public ServerResponse getCrawler3(){
        return crawlerService.getCrawler3();
    }
}
